<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>添加/编辑网点信息</title>
<#include '/frame/version.html'> 
<#include '/frame/manage/include_css.html'> 
<#include '/frame/manage/include_js.html'> 
<#include '/frame/taglib.html'>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.config.js"></script>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.all.js"></script>
<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
<script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
	</head>
	<body id="nv_member">
		<#assign current='menu_informationNotices'>
		<div id="wp" class="wp">
        <#include "/include/header.html"/>
			<div class="contentmanage">
				<div class="developer">
					<div class="tableContent">
                    <#include "/include/left.html"/> 
                    <#include "/include/wxtop.html"/>
						<div class="content">
							<div class="cLineB">
								<h4 style="font-size:16px;">添加/编辑列表</h4>
								<div class="pageNavigator right">
		                			<a class="btnGray" type="button" href="${base}/admin/org/index">返回</a>
		               			</div>
							</div>
							<form method="post" action="${basePath}/admin/informationNotices/save"  enctype="multipart/form-data" id="form">
								<input name="orgInfoId" value="${bean.orgInfoId}" type="hidden"/>
								<div class="msgWrap">
									<table class="userinfoArea" width="100%">
										<tbody>
								             <tr>
                                                <th valign="top"><span class="red">*</span>标题：</th>
                                                <td colspan="3">
	                                            <input type="text" class="px" id="title" value="" name="title" style="width:600px" maxlength=50 />
  	                                             <br />
  	                                                                                                                                     请不要多于50字!
                                                 </td>
                                            </tr>
											
											<tr>

 	                                              <th valign="top">上架/下架：</th>
 	                                              <td colspan="3">
	                                              <input type="radio" name="status" value="1" />上架&nbsp;&nbsp;&nbsp;
	                                              <input type="radio" name="status" value="0" checked="checked" />下架
                                                  </td>
                                           </tr>
                                           <tr>
	                                              <th valign="top">是否置顶：</th>
	                                              <td> 
		                                          <label for="radio1"><input id="radio1" class="radio" name="isTop" value="1"  type="radio"/>是</label>&nbsp; &nbsp; &nbsp;						  
		                                          <label for="radio2"><input  id="radio2" class="radio" name="isTop" value="0" type="radio" checked="checked"/>否</label> 																	
	                                              </td>
                                          <th valign="top">是否最新：</th>
                                                  <td>
                                                  <!-- for 属性规定 label 与哪个表单元素绑定。 -->
                                                  <label for="radio3"><input id="radio3" class="radio" name="isNew" value="1" type="radio"/>是</label>&nbsp; &nbsp; &nbsp;
                                                  <label for="radio4"><input id="radio4" class="radio" name="isNew" value="0" type="radio" checked="checked"/>否</label>
                                                  </td>
                                          </tr>
                                          <tr>
                                                   <th valign="top">LOGO：</th>
                                                   <td colspan="3">
                                                   <input readonly type="text" style="width:600px;" class="px" id="input_pic"  name="imgeUrl"/>
                                                   <a href="javascript:void(0);" class="a_upload" onclick="upyunPicUpload();">上传</a>
                                                   <a onclick="viewImg();" href="javascript:void(0);">预览</a>
                                                   </td> 	
                                          </tr>
                                          
                                         <th valign="top">摘要：</th>
                                                    <td colspan="3">
                                                    <!-- <textarea onpropertychange="if(value.length>500) value=value.substr(0,500)" class="px" id="content" name="content" style="width:400px; height: 80px;"></textarea> --> 
                                                    <script id="content" name="content" type="text/plain">
		 
                                                  	</script>
                                                    </td>
                                          </tr>
							              
										
										 <tr>  
                                         <th valign="top"></th>
	                                     <td colspan="3" align="center">
	                                     <input type="hidden" name="token" value="${token}" />
                                         <button type="button" name="button" class="btnGreen">保存</button>
                                         &nbsp;&nbsp;&nbsp; 
                                         <a href="javascript:history.go(-1);" class="btnGray vm">取消</a>
                                         </td> 
                                         </tr> 
										</tbody>
									</table>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
       <#include "/include/footer.html"/>
		<script type="text/javascript">
			$(function(){
	$(".btnGreen").click(function(){
		var title = $("#title").val();
		var imgeUrl = $("#input_pic").val();
		if($.trim(title)==""){
			layer.msg('请输入标题');
			return false;
		}
	
			$("#form").submit();
	});
   
}); 
var ue = UE.getEditor('content',{
	 autoHeightEnabled : false,
	 initialFrameWidth : 700,
	 initialFrameHeight : 500,
	 allowDivTransToP: false,
	 toolbars: [[
       'source', //源代码
       'fontfamily', //字体
       'fontsize', //字号
       'forecolor', //字体颜色
       'bold', //加粗
       'italic', //斜体
       'underline', //下划线
       'strikethrough', //删除线
       'subscript', //下标
       'fontborder', //字符边框
       'superscript', //上标
       'indent', //首行缩进
       'pasteplain', //纯文本粘贴模式
       'selectall', //全选
       'preview', //预览
       'horizontal', //分隔线
       'removeformat', //清除格式
       'time', //时间
       'date', //日期
       'unlink', //取消链接
       'inserttable', //插入表格
       'inserttitle', //插入标题
       'deletetable', //删除表格
       'cleardoc', //清空文档
       'paragraph', //段落格式
       'simpleupload', //单图上传
       'insertimage', //多图上传
       'link', //超链接
       'emotion', //表情
       'spechars', //特殊字符
       'map', //Baidu地图
       'insertvideo', //视频
       'justifyleft', //居左对齐
       'justifyright', //居右对齐
       'justifycenter', //居中对齐
       'justifyjustify', //两端对齐
       'backcolor', //背景色
       'fullscreen', //全屏
       'imagenone', //默认
       'imageleft', //左浮动
       'imageright', //右浮动
       'imagecenter', //居中
       'lineheight', //行间距
       'attachment', //附件
       'edittip ', //编辑提示
       'autotypeset', //自动排版
       'touppercase', //字母大写
       'tolowercase', //字母小写
       'background', //背景
       'template', //模板
       'scrawl', //涂鸦
       'music', //音乐
       'charts', // 图表
	]]
});
ue.addListener( 'ready', function( editor ) {
    layer.tips("<a href='javascript:void(0);' class='a_upload' onclick='openEditor();'>点我可以打开素材</a>","#edui1_toolbarbox",{tips: [2, '#44b549'],time:0});
});
    function openEditor(){
    	var left = 460;//$("#td_right_component").offset().left;
    	var height = ($(window).height()-10);
    	layer.open({
		    type: 2,
		    area: [left+'px', height+'px'],
		    fix: true,
		    shade:false,
		    offset: ['10px', '0px'],
		    title: false,
		    content: '${basePath}/anno/leditor'
		});
    }
    function insertIntoUe(content){
    	ue.setContent(content,true);
    }
var layerPicIndex = 0;
function upyunPicUpload(){
	layerPicIndex = layer.open({
	    type: 2,
	    area: ['600px', '450px'],
	    fix: true,
	    title: '上传图片',
	    content: '${basePath}/admin/informationNotices/upLogo'
	});
}
var layerFileIndex = 0;
function upyunFileUpload(){
	layerFileIndex = layer.open({
		type: 2,
		area: ['600px','450px'],
		fix: true,
		title: '上传文件',
		content: '${basePath}/admin/informationNotices/upFile'
	})
}
function closePicWin(url){
	if(null==url){
		layer.msg("上传失败，请重新上传",{shade:[0.8, '#393D49']});
		layer.close(layerPicIndex);
		return;
	}
	layer.msg("上传成功",{shade: [0.8, '#393D49']});
	layer.close(layerPicIndex);
	$("#input_pic").val(url);
}

function closeFileWin(url){
	if(null==url){
		layer.msg("上传失败，请重新上传",{shade:[0.8,'#393D49']});
		layer.close(layerFileIndex);
		return;
	}
	layer.msg("上传成功",{shade: [0.8, '#393D49']});
	layer.close(layerFileIndex);
	$("#source_file").val(url);
}
function viewImg(){
	var path = $("#input_pic").val();
	if(!path||path==""){
		layer.alert("无图片预览!",{icon:0});
		return;
	}
	layer.open({
	    type: 1,
	    area: ['500px', '500px'],
	    title: false,
	    skin: 'layui-layer-nobg',
	    shadeClose: true,
	    content: '<p style="text-align: center;"><img src="'+path+'" alt="无法显示图片" style="width:100%;height:100%;" /></p>'
	});
}


//ztree类型树
var setting = {
	view: {
		dblClickExpand: false
	},
	data: {
		simpleData: {
			enable: true
		}
	},
	callback: {
		beforeClick: beforeClick,
		onClick: onClick
	}
};

 <#if nodes?exists>
	var zNodes=${nodes};
<#else>
	var zNodes=[];
</#if>
function beforeClick(treeId, treeNode) {
	var check = (treeNode && !treeNode.isParent);
	if (!check) alert("请选择子类型！");
	return check;
}

function onClick(e, treeId, treeNode) {
    $("#docType").val("");
    $("#typeId").val("");
    $("#docType").val(treeNode.name);
    $("#typeId").val(treeNode.id);
}

function showMenu() {
	var cityObj = $("#docType");
	var cityOffset = $("#docType").offset();
	$("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");

	$("body").bind("mousedown", onBodyDown);
}
function hideMenu() {
	$("#menuContent").fadeOut("fast");
	$("body").unbind("mousedown", onBodyDown);
}
function onBodyDown(event) {
	if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
		hideMenu();
	}
}

$(document).ready(function(){
	$.fn.zTree.init($("#typeTree"), setting, zNodes);
});
		</script>
	</body>
</html>